#include "SymboleAff.hpp"

/* Constructeur. */
SymboleAff::SymboleAff(Type* type, string category):Symbole(category)
{
	this->type = type;
}

SymboleAff::SymboleAff(string category):Symbole(category)
{
	this->type = NULL;
}

int SymboleAff::setType(Type * type)
{
	if(this->type == NULL)
	{
		this->type = type;
		return 0;
	} else {
		return -1;
	}
}

bool SymboleAff::isAffected() const {
	return this->affected;
}

const Type* SymboleAff::getType() const {
	return this->type;
}

/*
   ostream& operator<<(ostream& os, const SymboleAff& symbAff)
   {
   os << symbAff.type;
   return os;
   }
   */


/* Destructeur. */
SymboleAff::~SymboleAff() {}

string SymboleAff::toString() const
{
  	stringstream oss;
  	oss <<  " (" << this->type << ", " << this->affected << ")";
  	return  oss.str();
}


